//
//  ThirdCell.m
//  ProjectA
//
//  Created by lanouhn on 15/5/28.
//  Copyright (c) 2015年 lanouhn. All rights reserved.
//

#import "ThirdCell.h"
#import "UIImageView+WebCache.h"
#define padding 10

@interface ThirdCell ()
@property (nonatomic ,retain)UIImageView *aViewOfImage;
@property (nonatomic ,retain)UILabel *titleLable;
@property (nonatomic ,retain)UILabel *subTitleLable;
@end
@implementation ThirdCell
- (void)dealloc{
    [_aViewOfImage release];
    [_titleLable release];
    [_subTitleLable release];
    [super dealloc];
}

- (UIImageView *)aViewOfImage {
    if (!_aViewOfImage) {
        self.aViewOfImage = [[[UIImageView alloc]initWithFrame:CGRectMake(10, 8, 50, 50)]autorelease];
        [self.contentView addSubview:_aViewOfImage];
    }
    return _aViewOfImage;
}
- (UILabel *)titleLable {
    if (!_titleLable) {
        self.titleLable = [[[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.aViewOfImage.frame) + padding * 2, padding * 2, 140, 40)]autorelease];
        [self.contentView addSubview:_titleLable];
    }
    return _titleLable;
}
- (UILabel *)subTitleLable {
    if (!_subTitleLable) {
        self.subTitleLable = [[[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.titleLable.frame), padding * 2, 100, 40)]autorelease];
        [self.contentView addSubview:_subTitleLable];
    }
    return _subTitleLable;
}
- (void)cellWithThirdModel:(ThirdModel *)model{
    [self.aViewOfImage sd_setImageWithURL:[NSURL URLWithString:model.img]];
    self.titleLable.text = model.title;
    self.subTitleLable.text = [NSString stringWithFormat:@"共%@个视频",model.count];
}
@end
